<!DOCTYPE html>
<html lang="zh-CN">
  <head>
  <meta charset="UTF-8">
  <meta 
    name="viewport"
    content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
  <meta 
    http-equiv="X-UA-Compatible" 
    content="ie=edge">
  <meta 
    name="theme-color" 
    content="#fff" 
    id="theme-color">
  <meta 
    name="description" 
    content="程序员的快乐小网站">
  <link 
    rel="icon" 
    href="https://demo.theme-kaze.top/img/Kaze.png">
  <title>GaussDB(for openGauss)初探 02</title>
  
    
      <meta 
        property="og:title" 
        content="GaussDB(for openGauss)初探 02">
    
    
      <meta 
        property="og:url" 
        content="http://www.baikaihua.gitee.io/2021/06/23/GaussDB(for%20openGauss)%E5%88%9D%E6%8E%A2%2002/index.html">
    
    
      <meta 
        property="og:img" 
        content="https://gitee.com/baikaihua/tochang/raw/master/src=http___b-ssl.duitang.com_uploads_item_201607_07_20160707163006_EnLeG.jpeg&amp;refer=http___b-ssl.duitang.jpg">
    
    
      <meta 
        property="og:img" 
        content="&lt;p&gt;GaussDB(for openGauss)的相关概念与常用数据类型。内容摘自华为官网发布的opengauss_devg文件。&lt;/p&gt;
&lt;p&gt;整理：白开画&lt;/p&gt;">
    
    
      <meta 
        property="og:type" 
        content="article">
      <meta 
        property="og:article:published_time" 
        content="2021-06-23">
      <meta 
        property="og:article:modified_time" 
        content="2021-10-01">
      <meta 
        property="og:article:author" 
        content="白开画 and 徐威">
      
        
          <meta 
            property="og:article:tag" 
            content="白开画">
        
          <meta 
            property="og:article:tag" 
            content="openGauss">
        
          <meta 
            property="og:article:tag" 
            content="Gauss">
        
          <meta 
            property="og:article:tag" 
            content="华为">
        
          <meta 
            property="og:article:tag" 
            content="Data Studio">
        
      
    
  
  <script>
    function loadScript(url, cb) {
      var script = document.createElement('script');
      script.src = url;
      if (cb) script.onload = cb;
      script.async = true;
      document.body.appendChild(script);
    }
    function loadCSS(href, data, attr) {
      var sheet = document.createElement('link');
      sheet.ref = 'stylesheet';
      sheet.href = href;
      sheet.dataset[data] = attr;
      document.head.appendChild(sheet);
    }
    function changeCSS(cssFile, data, attr) {
      var oldlink = document.querySelector(data);
      var newlink = document.createElement("link");
      newlink.setAttribute("rel", "stylesheet");
      newlink.setAttribute("href", cssFile);
      newlink.dataset.prism = attr;
      document.head.replaceChild(newlink, oldlink);
    }
  </script>
  
    
  
  <script>
    // control reverse button
    var reverseDarkList = {
      dark: 'light',
      light: 'dark'
    };
    var themeColor = {
      dark: '#1c1c1e',
      light: '#fff'
    }
    // get the data of css prefers-color-scheme
    var getCssMediaQuery = function() {
      return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
    };
    // reverse current darkmode setting function
    var reverseDarkModeSetting = function() {
      var setting = localStorage.getItem('user-color-scheme');
      if(reverseDarkList[setting]) {
        setting = reverseDarkList[setting];
      } else if(setting === null) {
        setting = reverseDarkList[getCssMediaQuery()];
      } else {
        return;
      }
      localStorage.setItem('user-color-scheme', setting);
      return setting;
    };
    // apply current darkmode setting
  </script>
  
    <script>
      var setDarkmode = function(mode) {
      var setting = mode || localStorage.getItem('user-color-scheme');
      if(setting === getCssMediaQuery()) {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[setting];
        document.getElementById('theme-color').dataset.mode = setting;
      } else if(reverseDarkList[setting]) {
        document.documentElement.setAttribute('data-user-color-scheme', setting);
        document.getElementById('theme-color').content = themeColor[setting];
        document.getElementById('theme-color').dataset.mode = setting;
      } else {
        document.documentElement.removeAttribute('data-user-color-scheme');
        localStorage.removeItem('user-color-scheme');
        document.getElementById('theme-color').content = themeColor[getCssMediaQuery()];
        document.getElementById('theme-color').dataset.mode = getCssMediaQuery();
      }
    };
    setDarkmode();
    </script>
  
  
  <link rel="preload" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css" as="style" >
  <link rel="preload" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css" as="style" >
  
  
    <link rel="preload" href="/js/lib/lightbox/baguetteBox.min.js" as="script">
    <link rel="preload" href="/js/lib/lightbox/baguetteBox.min.css" as="style" >
  
  
    <link rel="preload" href="/js/lib/lozad.min.js" as="script">
  
  
  
  
    
    <link rel="prefetch" href="//cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" as="script">
  
  
    
    <link rel="prefetch" href="//unpkg.com/valine/dist/Valine.min.js" as="script">
  
  
  
  <link rel="stylesheet" href="/css/main.css">
  
  <link rel="stylesheet" href="//at.alicdn.com/t/font_1946621_i1kgafibvw.css">
  
  <link rel="stylesheet" href="//at.alicdn.com/t/font_1952792_89b4ac4k4up.css">
  
    <link rel="stylesheet" href="/js/lib/lightbox/baguetteBox.min.css">
  
<meta name="generator" content="Hexo 5.4.0"></head>

  <body>
    <div class="wrapper">
       
      <nav class="navbar">
  <div class="navbar-logo">
    <span class="navbar-logo-main">
      
        <img 
          class="navbar-logo-img" 
          src="https://demo.theme-kaze.top/img/Kaze.png" 
          alt="blog logo">
      
      <span class="navbar-logo-dsc">程序小站</span>
    </span>
  </div>
  <div class="navbar-menu">
    
      <a 
        href="/" 
        class="navbar-menu-item">
        
          首页
        
      </a>
    
      <a 
        href="/archives" 
        class="navbar-menu-item">
        
          归档
        
      </a>
    
      <a 
        href="/tags" 
        class="navbar-menu-item">
        
          标签
        
      </a>
    
      <a 
        href="/categories" 
        class="navbar-menu-item">
        
          分类
        
      </a>
    
      <a 
        href="/about" 
        class="navbar-menu-item">
        
          关于
        
      </a>
    
    <a 
      class="navbar-menu-item darknavbar" 
      id="dark">
      <i class="iconfont icon-weather"></i>
    </a>
    <a 
      class="navbar-menu-item searchnavbar" 
      id="search">
      <i 
        class="iconfont icon-search" 
        style="font-size: 1.2rem; font-weight: 400;">
      </i>
    </a>
  </div>
</nav> 
      
      <div 
        id="local-search" 
        style="display: none">
        <input
          class="navbar-menu-item"
          id="search-input"
          placeholder="请输入搜索内容..." />
        <div id="search-content"></div>
      </div>
      
      <div class="section-wrap">
        <div class="container">
          <div class="columns">
            <main class="main-column">
<article class="card card-content">
  <header>
    <h1 class="post-title">
      GaussDB(for openGauss)初探 02
    </h1>
  </header>
  <div class="post-meta post-show-meta">
    <time datetime="2021-06-23T05:21:34.648Z">
      <i 
        class="iconfont icon-calendar" 
        style="margin-right: 2px;">
      </i>
      <span>2021-06-23</span>
    </time>
    
      <span class="dot"></span>
      
        <a 
          href="/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/" 
          class="post-meta-link">
          数据库
        </a>
      
    
    
      <span class="dot"></span>
      <span>2.5k 字</span>
    
  </div>
  
    <div 
      class="post-meta post-show-meta" 
      style="margin-top: -10px;">
      <div style="display: flex; align-items: center;">
        <i 
          class="iconfont icon-biaoqian" 
          style="margin-right: 2px; font-size: 1.15rem;">
        </i>
        
          
          <a 
            href="/tags/%E7%99%BD%E5%BC%80%E7%94%BB/" 
            class="post-meta-link">
            白开画
          </a>
        
          
            <span class="dot"></span>
          
          <a 
            href="/tags/openGauss/" 
            class="post-meta-link">
            openGauss
          </a>
        
          
            <span class="dot"></span>
          
          <a 
            href="/tags/Gauss/" 
            class="post-meta-link">
            Gauss
          </a>
        
          
            <span class="dot"></span>
          
          <a 
            href="/tags/%E5%8D%8E%E4%B8%BA/" 
            class="post-meta-link">
            华为
          </a>
        
          
            <span class="dot"></span>
          
          <a 
            href="/tags/Data-Studio/" 
            class="post-meta-link">
            Data Studio
          </a>
        
      </div>
    </div>
  
  </header>
  <div 
    id="section" 
    class="post-content">
    <p>GaussDB(for openGauss)的相关概念与常用数据类型。内容摘自华为官网发布的opengauss_devg文件。</p>
<p>整理：白开画</p>
<span id="more"></span>
<h1 id="相关概念"><a class="markdownIt-Anchor" href="#相关概念"></a> 相关概念</h1>
<table>
<thead>
<tr>
<th><strong>数据库</strong></th>
<th><strong>数据库用于管理各类数据对象，与其他数据库隔离。创建数据对象时可以指定对应的 表空间，如果不指定相应的表空间，相关的对象会默认保存在PG_DEFAULT空间中。 数据库管理的对象可分布在多个表空间上。</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>表空间</strong></td>
<td>在GaussDB(for openGauss)中，表空间是一个目录，可以存在多个，里面存储的是它 所包含的数据库的各种物理文件。由于表空间是一个目录，仅是起到了物理隔离的作 用，其管理功能依赖于文件系统。</td>
</tr>
<tr>
<td><strong>模式</strong></td>
<td>GaussDB(for openGauss)的模式是对数据库做一个逻辑分割。所有的数据库对象都建 立在模式下面。GaussDB(for openGauss)的模式和用户是弱绑定的，所谓的弱绑定是 指虽然创建用户的同时会自动创建一个同名模式，但用户也可以单独创建模式，并且 为用户指定其他的模式。</td>
</tr>
<tr>
<td><strong>用户和角色</strong></td>
<td>GaussDB(for openGauss)使用用户和角色来控制对数据库的访问。根据角色自身的设 置不同，一个角色可以看做是一个数据库用户，或者一组数据库用户。在GaussDB(for openGauss)中角色和用户之间的区别只在于角色默认是没有LOGIN权限的。在 GaussDB(for openGauss)中一个用户唯一对应一个角色，不过可以使用角色叠加来更 灵活地进行管理。</td>
</tr>
<tr>
<td><strong>事务管理</strong></td>
<td>在事务管理上，GaussDB(for openGauss)采取了MVCC（多版本并发控制）结合两阶 段锁的方式，其特点是读写之间不阻塞。GaussDB(for openGauss)的MVCC没有将历 史版本数据统一存放，而是和当前元组的版本放在了一起。GaussDB(for openGauss) 没有回滚段的概念，但是为了定期清除历史版本数据GaussDB(for openGauss)引入了 一个VACUUM线程。一般情况下用户不用关注它，除非要做性能调优。此外， GaussDB(for openGauss)是自动提交事务。</td>
</tr>
</tbody>
</table>
<h1 id="常用数据类型"><a class="markdownIt-Anchor" href="#常用数据类型"></a> 常用数据类型</h1>
<h2 id="数值类型"><a class="markdownIt-Anchor" href="#数值类型"></a> 数值类型</h2>
<h3 id="整数类型"><a class="markdownIt-Anchor" href="#整数类型"></a> 整数类型</h3>
<table>
<thead>
<tr>
<th><strong>名称</strong></th>
<th><strong>描述</strong></th>
<th><strong>储存空间</strong></th>
<th><strong>范围</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>TINYINT</td>
<td>微整数，别名为 INT1。</td>
<td>1字节</td>
<td>0 ~ 255</td>
</tr>
<tr>
<td>SMALLINT</td>
<td>小范围整数，别名为 INT2。</td>
<td>2字节</td>
<td>-32,768 ~ +32,767</td>
</tr>
<tr>
<td>INTEGER</td>
<td>常用的整数，别名为 INT4。</td>
<td>4字节</td>
<td>-2,147,483,648 ~ +2,147,483,647</td>
</tr>
<tr>
<td>BINARY_IN TEGER</td>
<td>常用的整数INTEGER 的别名，为兼容 Oracle类型。</td>
<td>4字节</td>
<td>-2,147,483,648 ~ +2,147,483,647</td>
</tr>
<tr>
<td>BIGINT</td>
<td>大范围的整数，别名 为INT8。</td>
<td>8字节</td>
<td>-9,223,372,036,854,775,808 ~ +9,223,372,036,854,775,807</td>
</tr>
</tbody>
</table>
<blockquote>
<p>● TINYINT、SMALLINT、INTEGER和BIGINT类型存储各种范围的数字，也就是整数。试图存 储超出范围以外的数值将会导致错误。</p>
<p>● 常用的类型是INTEGER，因为它提供了在范围、存储空间、性能之间的最佳平衡。一般只有 取值范围确定不超过SMALLINT的情况下，才会使用SMALLINT类型。而只有在INTEGER的 范围不够的时候才使用BIGINT，因为前者相对快得多。</p>
</blockquote>
<h3 id="任意精度型"><a class="markdownIt-Anchor" href="#任意精度型"></a> 任意精度型</h3>
<table>
<thead>
<tr>
<th><strong>名称</strong></th>
<th><strong>描述</strong></th>
<th><strong>存储空间</strong></th>
<th><strong>范围</strong></th>
</tr>
</thead>
<tbody>
<tr>
<td>NUMERIC[ (p[,s])], DECIMAL[ (p[,s])]</td>
<td>精度p取值范围为 [1,1000]，标度s取 值范围为[0,p]。 <strong>说明：</strong> p为总位数，s为小 数位数。</td>
<td>用户声明精度。每四 位（十进制位）占用 两个字节，然后在整 个数据上加上八个字 节的额外开销。</td>
<td>未指定精度的情况下， 小数点前最大131,072 位，小数点后最大 16,383位。</td>
</tr>
<tr>
<td>NUMBER[( p[,s])]</td>
<td>NUMERIC类型的 别名，为兼容 Oracle数据类型。</td>
<td>用户声明精度。每四 位（十进制位）占用 两个字节，然后在整 个数据上加上八个字 节的额外开销。</td>
<td>未指定精度的情况下， 小数点前最大131,072 位，小数点后最大 16,383位。</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
</table>
<blockquote>
<p>● 与整数类型相比，任意精度类型需要更大的存储空间，其存储效率、运算效率以及压缩比效 果都要差一些。在进行数值类型定义时，优先选择整数类型。当且仅当数值超出整数可表示 最大范围时，再选用任意精度类型。</p>
<p>● 使用Numeric/Decimal进行列定义时，建议指定该列的精度p以及标度s。</p>
</blockquote>
<h3 id="浮点型"><a class="markdownIt-Anchor" href="#浮点型"></a> 浮点型</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>描述</th>
<th>储存空间</th>
<th>范围</th>
</tr>
</thead>
<tbody>
<tr>
<td>REAL, FLOAT4</td>
<td>单精度浮点数，不 精准。</td>
<td>4字节</td>
<td>6位十进制数字精度。</td>
</tr>
<tr>
<td>DOUBLE PRECISION , FLOAT8</td>
<td>双精度浮点数，不 精准。</td>
<td>8字节</td>
<td>1E-307~1E+308， 15位十进制数字精度。</td>
</tr>
<tr>
<td>FLOAT[§ ]</td>
<td>浮点数，不精准。 精度p取值范围为 [1,53]。 <strong>说明：</strong> p为精度，表示总位 数。</td>
<td>4字节或8字节</td>
<td>根据精度p不同选择 REAL或DOUBLE PRECISION作为内部表 示。如不指定精度，内 部用DOUBLE PRECISION表示。</td>
</tr>
<tr>
<td>BINARY_D OUBLE</td>
<td>是DOUBLE PRECISION的别 名，为兼容Oracle 类型。</td>
<td>8字节</td>
<td>1E-307~1E+308， 15位十进制数字精度。</td>
</tr>
<tr>
<td>DEC[(p[,s] )]</td>
<td>精度p取值范围为 [1,1000]，标度s取 值范围为[0,p]。 <strong>说明：</strong> p为总位数，s为小 数位位数。</td>
<td>用户声明精度。每四 位（十进制位）占用 两个字节，然后在整 个数据上加上八个字 节的额外开销。</td>
<td>用户声明精度。每四 位（十进制位）占用 两个字节，然后在整 个数据上加上八个字 节的额外开销。</td>
</tr>
<tr>
<td>INTEGER[( p[,s])]</td>
<td>精度p取值范围为 [1,1000]，标度s取 值范围为[0,p]。</td>
<td>用户声明精度。每四 位（十进制位）占用 两个字节，然后在整 个数据上加上八个字 节的额外开销。</td>
<td>未指定精度的情况下， 小数点前最大131,072 位，小数点后最大 16,383位。</td>
</tr>
</tbody>
</table>
<h2 id="字符类型"><a class="markdownIt-Anchor" href="#字符类型"></a> 字符类型</h2>
<h3 id="字符类型-2"><a class="markdownIt-Anchor" href="#字符类型-2"></a> 字符类型</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>描述</th>
<th>储存空间</th>
</tr>
</thead>
<tbody>
<tr>
<td>CHAR(n) CHARACTER(n) NCHAR(n)</td>
<td>定长字符串，不足补空格。n是指字节长 度，如不带精度n，默认精度为1。</td>
<td>最大为10MB。</td>
</tr>
<tr>
<td>VARCHAR(n) CHARACTER VARYING(n)</td>
<td>变长字符串。n是指字节长度。</td>
<td>最大为10MB。</td>
</tr>
<tr>
<td>VARCHAR2(n)</td>
<td>变长字符串。是VARCHAR(n)类型的别名， 为兼容Oracle类型。n是指字节长度。</td>
<td>最大为10MB。</td>
</tr>
<tr>
<td>NVARCHAR2(n)</td>
<td>变长字符串。n是指字节长度。</td>
<td>最大为10MB。</td>
</tr>
<tr>
<td>CLOB</td>
<td>文本大对象。是TEXT类型的别名，为兼容 Oracle类型。</td>
<td>最大为 1GB-8203字节 （即 1073733621字 节）。</td>
</tr>
<tr>
<td>TEXT</td>
<td>变长字符串。</td>
<td>最大为 1GB-8203字节 （即 1073733621字 节）。</td>
</tr>
</tbody>
</table>
<blockquote>
<p>除了每列的大小限制以外，每个元组的总大小也不可超过1GB-8203字节（即 1073733621字节）。</p>
</blockquote>
<h3 id="特殊字符类型"><a class="markdownIt-Anchor" href="#特殊字符类型"></a> 特殊字符类型</h3>
<table>
<thead>
<tr>
<th>名称</th>
<th>描述</th>
<th>储存空间</th>
</tr>
</thead>
<tbody>
<tr>
<td>name</td>
<td>用于对象名的内部类型。</td>
<td>64字节。</td>
</tr>
<tr>
<td>“char”</td>
<td>单字节内部类型。</td>
<td>1字节。</td>
</tr>
</tbody>
</table>
<blockquote>
<p>在GaussDB(for openGauss)里另外还有两种定长字符类型。在。name 类型只用在内部系统表中，作为存储标识符，不建议普通用户使用。该类型长度当前 定为64字节（63可用字符加结束符）。类型&quot;char&quot;只用了一个字节的存储空间。他在 系统内部主要用于系统表，主要作为简单化的枚举类型使用。</p>
</blockquote>
<h2 id="二进制类型"><a class="markdownIt-Anchor" href="#二进制类型"></a> 二进制类型</h2>
<table>
<thead>
<tr>
<th>名称</th>
<th>描述</th>
<th>储存空间</th>
</tr>
</thead>
<tbody>
<tr>
<td>BLOB</td>
<td>二进制大对象 目前BLOB支持的外部存取接口仅 为： ● DBE_LOB.GETLENGTH ● DBE_LOB.READ ● DBE_LOB.WRITE ● DBE_LOB.WRITEAPPEND ● DBE_LOB.COPY ● DBE_LOB.ERASE 这些接口详细说明请参见 15.12.2.1 。 <strong>说明：</strong> 列存不支持BLOB类型</td>
<td>最大为1GB减去53字节（即 1073741771字节）。</td>
</tr>
<tr>
<td>RAW</td>
<td>变长的十六进制类型 <strong>说明：</strong> 列存不支持RAW类型</td>
<td>4字节加上实际的十六进制字符串。最 大为1GB减去53字节（即1073741771 字节）。</td>
</tr>
<tr>
<td>BYTE A</td>
<td>变长的二进制字符串</td>
<td>4字节加上实际的二进制字符串。最大 为1GB减去53字节（即1073741771字 节）。</td>
</tr>
</tbody>
</table>
<blockquote>
<p>除了每列的大小限制以外，每个元组的总大小也不可超过1GB-53字节（即 1073741771字节）。</p>
</blockquote>
<h2 id="日期时间类型"><a class="markdownIt-Anchor" href="#日期时间类型"></a> 日期/时间类型</h2>
<table>
<thead>
<tr>
<th>名称</th>
<th>描述</th>
<th>储存空间</th>
</tr>
</thead>
<tbody>
<tr>
<td>DATE</td>
<td>日期和时间。</td>
<td>4字节（实际存储空 间大小为8字节）</td>
</tr>
<tr>
<td>TIME [§] [WITHOUT TIME ZONE]</td>
<td>只用于一日内时间。 p表示小数点后的精度，取值范围为 0~6。</td>
<td>8字节</td>
</tr>
<tr>
<td>TIME [§] [WITH TIME ZONE]</td>
<td>只用于一日内时间，带时区。 p表示小数点后的精度，取值范围为 0~6。</td>
<td>12字节</td>
</tr>
<tr>
<td>TIMESTAMP[§] [WITHOUT TIME ZONE]</td>
<td>日期和时间。 p表示小数点后的精度，取值范围为 0~6。</td>
<td>8字节</td>
</tr>
<tr>
<td>TIMESTAMP[§] [WITH TIME ZONE]</td>
<td>日期和时间，带时区。TIMESTAMP 的别名为TIMESTAMPTZ。 p表示小数点后的精度，取值范围为 0~6。</td>
<td>8字节</td>
</tr>
<tr>
<td>SMALLDATETIME</td>
<td>日期和时间，不带时区。 精确到分钟，秒位大于等于30秒进一 位。</td>
<td>8字节</td>
</tr>
<tr>
<td>INTERVAL DAY (l) TO SECOND §</td>
<td>时间间隔，X天X小时X分X秒。 ● l：天数的精度，取值范围为0~6。 为适配Oracle语法，未实现具体功 能。 ● p：秒数的精度，取值范围为 0~6。小数末尾的零不显示。</td>
<td>16字节</td>
</tr>
<tr>
<td>INTERVAL [FIELDS] [ § ]</td>
<td>时间间隔。 ● fiÃä：可以是YEAR，MONTH， DAY，HOUR，MINUTE， SECOND，DAY TO HOUR，DAY TO MINUTE，DAY TO SECOND，HOUR TO MINUTE， HOUR TO SECOND，MINUTE TO SECOND。 ● p：秒数的精度，取值范围为 0~6，且fiÃä为SECOND，DAY TO SECOND，HOUR TO SECOND或MINUTE TO SECOND 时，参数p才有效。小数末尾的零 不显示。</td>
<td>12字节</td>
</tr>
<tr>
<td>reltime</td>
<td>相对时间间隔。格式为： X years X mons X days XX:XX:XX。 ● 采用儒略历计时，规定一年为 365.25天，一个月为30天，计算 输入值对应的相对时间间隔，输出 采用POSTGRES格式。</td>
<td>4字节</td>
</tr>
</tbody>
</table>
<blockquote>
<p>如果其他的数据库时间格式和GaussDB(for openGauss)的时间格式不一致，可通过修 改配置参数DateStyle的值来保持一致。</p>
</blockquote>

  </div>
  <div>
    
      <div 
        class="post-note note-warning copyright" 
        style="margin-top: 42px">
        <p>
          <span style="font-weight: bold;">作者：</span><a 
            target="_blank" 
            rel="nofollow noopener noreferrer" 
            href="/about">
            白开画 and 徐威
          </a>
        </p>
        <p>
          <span style="font-weight: bold;">文章链接：</span><a 
            target="_blank" 
            rel="nofollow noopener noreferrer" 
            href="http://www.baikaihua.gitee.io/2021/06/23/GaussDB(for%20openGauss)%E5%88%9D%E6%8E%A2%2002/index.html">
            http://www.baikaihua.gitee.io/2021/06/23/GaussDB(for%20openGauss)%E5%88%9D%E6%8E%A2%2002/index.html
          </a>
        </p>
        <p><span style="font-weight: bold;">版权声明：</span>本博客所有文章除特别声明外，均采用<a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0 协议</a>。转载请注明出处！</p>
      </div>
    
  </div>
</article>
<div class="nav">
  
    <div class="nav-item-prev">
      <a 
        href="/2021/06/25/Mysql%E5%88%9D%E6%8E%A202/index.html" 
        class="nav-link">
        <i class="iconfont icon-left nav-prev-icon"></i>
        <div>
          <div class="nav-label">上一篇</div>
          
            <div class="nav-title">MySQL 初探02 </div>
          
        </div>
      </a>
    </div>
  
  
    <div class="nav-item-next">
      <a 
        href="/2021/06/22/opengauss%E7%9A%84%E7%AE%80%E5%8D%95%E6%93%8D%E4%BD%9C%EF%BC%8801%EF%BC%89/index.html" 
        class="nav-link">
        <div>
          <div class="nav-label">下一篇</div>
          
            <div class="nav-title">GaussDB(for openGauss)初探 01 </div>
          
        </div>
        <i class="iconfont icon-right nav-next-icon"></i>
      </a>
    </div>
  
</div>

  <div 
    class="card card-content comment-card" 
    style="margin-top: 16px;">
    <div class="comment-card-title">评论</div>
    
  <div id="vcomments"></div>
  
  <script>
    loadScript("//unpkg.com/valine/dist/Valine.min.js");
    var oldLoadVa = window.onload;
    window.onload = function () {
      oldLoadVa && oldLoadVa();
      new Valine({
        el: '#vcomments',
        appId: 'C2ey5RzCeMGvikIpezIqS1fW-gzGzoHsz',
        appKey: 'yNj1HPpcuT4nFzgDG1hfxiwX',
        placeholder: 'Just go go',
        path: window.location.pathname,
        avatar: 'mp',
        meta: ["nick","mail","link"],
        pageSize: '10',
        lang: '',
        visitor: 'false',
        highlight: true,
        recordIP: false,
        
        
        
        enableQQ: 'false',
        requiredFields: [],
      });
    };
  </script>

  </div>

<div 
  class="card card-content toc-card" 
  id="mobiletoc">
  <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E7%9B%B8%E5%85%B3%E6%A6%82%E5%BF%B5"><span class="toc-number">1.</span> <span class="toc-text"> 相关概念</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%B8%B8%E7%94%A8%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.</span> <span class="toc-text"> 常用数据类型</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%95%B0%E5%80%BC%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.1.</span> <span class="toc-text"> 数值类型</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%95%B4%E6%95%B0%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.1.1.</span> <span class="toc-text"> 整数类型</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BB%BB%E6%84%8F%E7%B2%BE%E5%BA%A6%E5%9E%8B"><span class="toc-number">2.1.2.</span> <span class="toc-text"> 任意精度型</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%B5%AE%E7%82%B9%E5%9E%8B"><span class="toc-number">2.1.3.</span> <span class="toc-text"> 浮点型</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AD%97%E7%AC%A6%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.2.</span> <span class="toc-text"> 字符类型</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AD%97%E7%AC%A6%E7%B1%BB%E5%9E%8B-2"><span class="toc-number">2.2.1.</span> <span class="toc-text"> 字符类型</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%89%B9%E6%AE%8A%E5%AD%97%E7%AC%A6%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.2.2.</span> <span class="toc-text"> 特殊字符类型</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BA%8C%E8%BF%9B%E5%88%B6%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.3.</span> <span class="toc-text"> 二进制类型</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%97%A5%E6%9C%9F%E6%97%B6%E9%97%B4%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.4.</span> <span class="toc-text"> 日期&#x2F;时间类型</span></a></li></ol></li></ol>
</div></main>
            <aside class="left-column">
              
              <div class="card card-author">
                
  <img 
    src="https://gitee.com/baikaihua/tochang/raw/master/src=http___b-ssl.duitang.com_uploads_item_201607_07_20160707163006_EnLeG.jpeg&refer=http___b-ssl.duitang.jpg" 
    class="author-img" 
    alt="author avatar">

<p class="author-name">白开画 and 徐威</p>
<p class="author-description">欢迎！</p>
<div class="author-message">
  <a 
    class="author-posts-count" 
    href="/archives">
    <span>33</span>
    <span>文章</span>
  </a>
  <a 
    class="author-categories-count" 
    href="/categories">
    <span>11</span>
    <span>分类</span>
  </a>
  <a 
    class="author-tags-count" 
    href="/tags">
    <span>37</span>
    <span>标签</span>
  </a>
</div>

              </div>
               <div class="sticky-tablet">
  
  
    <article class="display-when-two-columns spacer">
      <div class="card card-content toc-card">
        <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E7%9B%B8%E5%85%B3%E6%A6%82%E5%BF%B5"><span class="toc-number">1.</span> <span class="toc-text"> 相关概念</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%B8%B8%E7%94%A8%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.</span> <span class="toc-text"> 常用数据类型</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%95%B0%E5%80%BC%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.1.</span> <span class="toc-text"> 数值类型</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%95%B4%E6%95%B0%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.1.1.</span> <span class="toc-text"> 整数类型</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BB%BB%E6%84%8F%E7%B2%BE%E5%BA%A6%E5%9E%8B"><span class="toc-number">2.1.2.</span> <span class="toc-text"> 任意精度型</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%B5%AE%E7%82%B9%E5%9E%8B"><span class="toc-number">2.1.3.</span> <span class="toc-text"> 浮点型</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AD%97%E7%AC%A6%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.2.</span> <span class="toc-text"> 字符类型</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AD%97%E7%AC%A6%E7%B1%BB%E5%9E%8B-2"><span class="toc-number">2.2.1.</span> <span class="toc-text"> 字符类型</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%89%B9%E6%AE%8A%E5%AD%97%E7%AC%A6%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.2.2.</span> <span class="toc-text"> 特殊字符类型</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BA%8C%E8%BF%9B%E5%88%B6%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.3.</span> <span class="toc-text"> 二进制类型</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%97%A5%E6%9C%9F%E6%97%B6%E9%97%B4%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.4.</span> <span class="toc-text"> 日期&#x2F;时间类型</span></a></li></ol></li></ol>
      </div>
    </article>
  
  
  <article class="card card-content categories-widget">
    <div class="categories-card">
  <div class="categories-header">
    <i 
      class="iconfont icon-fenlei" 
      style="padding-right: 2px;">
    </i>分类
  </div>
  <div class="categories-list">
    
      <a href="/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BD%91%E7%BB%9C/">
        <div class="categories-list-item">
          计算机网络
          <span class="categories-list-item-badge">5</span>
        </div>
      </a>
    
      <a href="/categories/%E6%95%B0%E6%8D%AE%E5%BA%93/">
        <div class="categories-list-item">
          数据库
          <span class="categories-list-item-badge">3</span>
        </div>
      </a>
    
      <a href="/categories/PHP/">
        <div class="categories-list-item">
          PHP
          <span class="categories-list-item-badge">14</span>
        </div>
      </a>
    
      <a href="/categories/Windows%E7%B3%BB%E7%BB%9F/">
        <div class="categories-list-item">
          Windows系统
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
      <a href="/categories/Python/">
        <div class="categories-list-item">
          Python
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
      <a href="/categories/Linux/">
        <div class="categories-list-item">
          Linux
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
      <a href="/categories/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B8%8E%E7%AE%97%E6%B3%95/">
        <div class="categories-list-item">
          数据结构与算法
          <span class="categories-list-item-badge">2</span>
        </div>
      </a>
    
      <a href="/categories/%E7%BD%91%E7%BB%9C/">
        <div class="categories-list-item">
          网络
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
      <a href="/categories/%E8%B7%AF%E7%94%B1%E4%BA%A4%E6%8D%A2/">
        <div class="categories-list-item">
          路由交换
          <span class="categories-list-item-badge">3</span>
        </div>
      </a>
    
      <a href="/categories/%E8%BD%AC%E8%BD%BD/">
        <div class="categories-list-item">
          转载
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
      <a href="/categories/python/">
        <div class="categories-list-item">
          python
          <span class="categories-list-item-badge">1</span>
        </div>
      </a>
    
  </div>
</div>
  </article>
  
  <article class="card card-content tags-widget">
    <div class="tags-card">
  <div class="tags-header">
    <i 
      class="iconfont icon-biaoqian" 
      style="padding-right: 2px;">
    </i>热门标签
  </div>
  <div class="tags-list">
    
      <a 
        href="/tags/%E7%99%BD%E5%BC%80%E7%94%BB/" 
        title="白开画">
        <div class="tags-list-item">白开画</div>
      </a>
    
      <a 
        href="/tags/%E5%BE%90%E5%A8%81/" 
        title="徐威">
        <div class="tags-list-item">徐威</div>
      </a>
    
      <a 
        href="/tags/PHP/" 
        title="PHP">
        <div class="tags-list-item">PHP</div>
      </a>
    
      <a 
        href="/tags/web%E8%84%9A%E6%9C%AC/" 
        title="web脚本">
        <div class="tags-list-item">web脚本</div>
      </a>
    
      <a 
        href="/tags/%E7%BD%91%E7%BB%9C/" 
        title="网络">
        <div class="tags-list-item">网络</div>
      </a>
    
      <a 
        href="/tags/%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%BD%91%E7%BB%9C/" 
        title="计算机网络">
        <div class="tags-list-item">计算机网络</div>
      </a>
    
      <a 
        href="/tags/%E5%8D%8E%E4%B8%BA/" 
        title="华为">
        <div class="tags-list-item">华为</div>
      </a>
    
      <a 
        href="/tags/%E5%8D%8E%E4%B8%BA%E8%AE%A4%E8%AF%81/" 
        title="华为认证">
        <div class="tags-list-item">华为认证</div>
      </a>
    
      <a 
        href="/tags/%E8%B7%AF%E7%94%B1%E4%BA%A4%E6%8D%A2/" 
        title="路由交换">
        <div class="tags-list-item">路由交换</div>
      </a>
    
      <a 
        href="/tags/GVRP/" 
        title="GVRP">
        <div class="tags-list-item">GVRP</div>
      </a>
    
      <a 
        href="/tags/VLAN/" 
        title="VLAN">
        <div class="tags-list-item">VLAN</div>
      </a>
    
      <a 
        href="/tags/%E5%9F%BA%E7%A1%80/" 
        title="基础">
        <div class="tags-list-item">基础</div>
      </a>
    
      <a 
        href="/tags/ip/" 
        title="ip">
        <div class="tags-list-item">ip</div>
      </a>
    
      <a 
        href="/tags/%E5%A4%A7%E6%95%B0/" 
        title="大数">
        <div class="tags-list-item">大数</div>
      </a>
    
      <a 
        href="/tags/python/" 
        title="python">
        <div class="tags-list-item">python</div>
      </a>
    
      <a 
        href="/tags/%E5%91%BD%E4%BB%A4%E6%8F%90%E7%A4%BA%E7%AC%A6/" 
        title="命令提示符">
        <div class="tags-list-item">命令提示符</div>
      </a>
    
  </div>
</div>
  </article>
  
  
</div>
            </aside>
            <aside class="right-column">
              <div class="sticky-widescreen">
  
  
    <article class="card card-content toc-card">
      <div class="toc-header">
  <i 
    class="iconfont icon-menu" 
    style="padding-right: 2px;">
  </i>目录
</div>
<ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E7%9B%B8%E5%85%B3%E6%A6%82%E5%BF%B5"><span class="toc-number">1.</span> <span class="toc-text"> 相关概念</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%B8%B8%E7%94%A8%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.</span> <span class="toc-text"> 常用数据类型</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%95%B0%E5%80%BC%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.1.</span> <span class="toc-text"> 数值类型</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%95%B4%E6%95%B0%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.1.1.</span> <span class="toc-text"> 整数类型</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E4%BB%BB%E6%84%8F%E7%B2%BE%E5%BA%A6%E5%9E%8B"><span class="toc-number">2.1.2.</span> <span class="toc-text"> 任意精度型</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%B5%AE%E7%82%B9%E5%9E%8B"><span class="toc-number">2.1.3.</span> <span class="toc-text"> 浮点型</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E5%AD%97%E7%AC%A6%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.2.</span> <span class="toc-text"> 字符类型</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%AD%97%E7%AC%A6%E7%B1%BB%E5%9E%8B-2"><span class="toc-number">2.2.1.</span> <span class="toc-text"> 字符类型</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%89%B9%E6%AE%8A%E5%AD%97%E7%AC%A6%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.2.2.</span> <span class="toc-text"> 特殊字符类型</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E4%BA%8C%E8%BF%9B%E5%88%B6%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.3.</span> <span class="toc-text"> 二进制类型</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#%E6%97%A5%E6%9C%9F%E6%97%B6%E9%97%B4%E7%B1%BB%E5%9E%8B"><span class="toc-number">2.4.</span> <span class="toc-text"> 日期&#x2F;时间类型</span></a></li></ol></li></ol>
    </article>
  
  
  <article class="card card-content">
    <div class="recent-posts-card">
  <div class="recent-posts-header">
    <i 
      class="iconfont icon-wenzhang_huaban" 
      style="padding-right: 2px;">
    </i>最近文章
  </div>
  <div class="recent-posts-list">
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-12-13</div>
        <a href="/2021/12/13/python%E7%88%AC%E5%8F%96%E6%B7%98%E5%AE%9D%E5%95%86%E5%93%81/index.html"><div class="recent-posts-item-content">python爬取淘宝商品</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-12-13</div>
        <a href="/2021/12/13/PHP%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%B8%B8%E7%94%A8%E6%93%8D%E4%BD%9C/index.html"><div class="recent-posts-item-content">PHP字符串常用操作</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-11-29</div>
        <a href="/2021/11/29/PHP%E8%AE%A4%E8%AF%86%E5%AD%97%E7%AC%A6%E4%B8%B2/index.html"><div class="recent-posts-item-content">PHP认识字符串</div></a>
      </div>
    
      <div class="recent-posts-item">
        <div class="recent-posts-item-title">2021-11-21</div>
        <a href="/2021/11/21/PHP%E5%87%BD%E6%95%B0%E7%9A%84%E5%BA%94%E7%94%A8/index.html"><div class="recent-posts-item-content">PHP函数的应用</div></a>
      </div>
    
  </div>
</div>
  </article>
  
  
</div>
            </aside>
          </div>
        </div>
      </div>
    </div>
     
    <footer class="footer">
  <div class="footer-container">
    <div>
      <div class="footer-dsc">
        <span>
          Copyright ©
          
            2021 -
          
          2021
        </span>
        &nbsp;
        <a 
          href="/" 
          class="footer-link">
          程序小站
        </a>
      </div>
    </div>

    
      <div class="footer-dsc">
        
          Powered by
          <a 
            href="https://hexo.io/" 
            class="footer-link" 
            target="_blank" 
            rel="nofollow noopener noreferrer">
            &nbsp;Hexo
          </a>
        
        
          <span>&nbsp;|&nbsp;</span>
        
        
          Theme -
          <a 
            href="https://github.com/theme-kaze" 
            class="footer-link" 
            target="_blank"
            rel="nofollow noopener noreferrer">
            &nbsp;Kaze
          </a>
        
      </div>
    
    
    
    
      <div class="footer-dsc">
        
          本站总访问量<span id="busuanzi_value_site_pv"></span>次
        
        
          <span>&nbsp;|&nbsp;</span>
        
        
          本站总访客数<span id="busuanzi_value_site_uv"></span>次
        
      </div>
      
    
</footer> 
    
  <a 
    role="button" 
    id="scrollbutton" 
    class="basebutton" 
    aria-label="回到顶部">
    <i class="iconfont icon-arrowleft button-icon"></i>
  </a>

<a 
  role="button" 
  id="menubutton" 
  class="basebutton">
  <i class="iconfont icon-menu button-icon"></i>
</a>
<a 
  role="button" 
  id="popbutton" 
  class="basebutton" 
  aria-label="控制中心">
  <i class="iconfont icon-expand button-icon"></i>
</a>
<a 
  role="button" 
  id="darkbutton" 
  class="basebutton darkwidget" 
  aria-label="夜色模式">
  <i class="iconfont icon-weather button-icon"></i>
</a>
<a 
  role="button" 
  id="searchbutton" 
  class="basebutton searchwidget" 
  aria-label="搜索">
  <i class="iconfont icon-search button-icon"></i>
</a> 
     
     
      

  
  
    
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css">

  
 
     
     
      <script>
  var addImgLayout = function () {
    var img = document.querySelectorAll('.post-content img')
    var i
    for (i = 0; i < img.length; i++) {
      var wrapper = document.createElement('a')
      wrapper.setAttribute('href', img[i].getAttribute('data-src'))
      wrapper.setAttribute('aria-label', 'illustration')
      wrapper.style.cssText =
        'width: 100%; display: flex; justify-content: center;'
      if (img[i].alt) wrapper.dataset.caption = img[i].alt
      wrapper.dataset.nolink = true
      img[i].before(wrapper)
      wrapper.append(img[i])
      var divWrap = document.createElement('div')
      divWrap.classList.add('gallery')
      wrapper.before(divWrap)
      divWrap.append(wrapper)
    }
    baguetteBox.run('.gallery')
  }
</script>
<script>
  loadScript(
    "/js/lib/lightbox/baguetteBox.min.js",
    addImgLayout
  )
</script>
 
     
     
    <script src="/js/main.js"></script> 
    
      <script> 
        loadScript('/js/lib/busuanzi.min.js') 
      </script>
     
    
      <script>
        var addLazyload = function () {
          var observer = lozad('.lozad', {
            load: function (el) {
              el.srcset = el.getAttribute('data-src')
            },
            loaded: function (el) {
              el.classList.add('loaded')
            },
          })
          observer.observe()
        }
      </script>
      <script>
        loadScript('/js/lib/lozad.min.js', addLazyload)
      </script>
     
    
    
      <script>
        setTimeout(() => {localSearch("search.json")}, 0)
      </script>
    
  </body>
</html>
